#pragma once

struct MemoryLocation
{
	uint m_size;
	uint m_offset;

	MemoryLocation(uint size, uint offset);
};

class RBuffer
{
public:
	RBuffer(uint size, bool dynamic, GLenum type);
	~RBuffer();

	uchar*			Lock(uint size, uint offset);
	uint			GetSize() const;
	bool			IsDynamic() const;

	uint			GetHandle();
	void			Flush();

private:
	IMutex*			m_mutex;
	uchar*			m_data;
	uint			m_size;
	bool			m_dynamic;
	uint			m_handle;
	GLenum			m_type;

	std::vector<MemoryLocation> m_updatedLocations;
};

